const router = require('koa-router')();
const { verify } = require('../../utils/auth');
const UploadController = require('../../controllers/system/uploadController');

router.use(verify);
router.post('/upload', UploadController.uploadFile);
router.post('/delfile', UploadController.deleteFiles);

module.exports = router;
/**
 * @swagger
 * tags:
 *   name: 文件上传
 *   description: 文件上传和管理接口
 */

/**
 * @swagger
 * /upload:
 *   post:
 *     tags: [文件上传]
 *     summary: 上传文件
 *     security:
 *       - bearerAuth: []
 *     requestBody:
 *       required: true
 *       content:
 *         multipart/form-data:
 *           schema:
 *             type: object
 *             properties:
 *               file:
 *                 type: string
 *                 format: binary
 *     responses:
 *       200:
 *         description: 上传成功
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 url:
 *                   type: string
 *                   description: 文件访问URL
 */

/**
 * @swagger
 * /delfile:
 *   post:
 *     tags: [文件上传]
 *     summary: 删除文件
 *     security:
 *       - bearerAuth: []
 *     requestBody:
 *       required: true
 *       content:
 *         application/json:
 *           schema:
 *             type: object
 *             properties:
 *               filePath:
 *                 type: string
 *                 description: 要删除的文件路径
 *     responses:
 *       200:
 *         description: 删除成功
 */

